
// represents a Person with a user name and a list of buddies
class Person {

  String username;
  ILoBuddy buddies;
  
  Person(String username) {
    this.username = username;
    this.buddies = new MTLoBuddy();
  }
  
  // add the given person to this person's list of buddies
  void addBuddy(Person p){
  	this.buddies = this.buddies.add(p);
  }
  
  // remove all buddies from the buddy list
  void removeAll(){
  	this.buddies = new MTLoBuddy();
  }
  
  // returns true if this Person has that as a direct buddy
  boolean hasDirectBuddy(Person that) {
    return this.buddies.contains(that);
  }
  
  boolean equalsp(Person th){
    return this.username.equals(th.username);
  }

  // returns the number of people that are direct buddies 
  // of both this and that person
  int countCommonBuddies(Person that) {
    return this.buddies.compareCount(that.buddies);
  }
  
  // will the given person be invited to a party 
  // organized by this person?
  boolean hasDistantBuddy(Person that) {
    return this.buddies.checkDistant(that);
  }
  
  // returns the number of people who will show up at the party 
  // given by this person
  int partyCount(){
	  return this.buddies.partyCount(this);
  }
 
}